<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
          var arr1 = [1, 1, 2, 3, 4, 4, 2, 1, 3, 5]
          
            // 定义函数
            function norepeat(arr){
                
                for(var j = 0;j<arr.length;j++){
                var simple = arr[j]
              for(var i =j+1;i < arr.length; i++){
                 if (arr[i] === simple) {
                     arr.splice(i,1)
                 }
              }
             }
            return arr
        }
            console.log(norepeat(arr1));
         
    
            
   
    </script>
</body>
</html>